package com.story.modular.app.service.impl;

import java.util.List;
import java.util.Map;

import com.story.common.persistence.model.Search;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.story.modular.app.dao.SearchMapper;
import com.story.modular.app.service.SearchService;

/**
 * ---------------------------
 *  (SearchServiceImpl)         
 * ---------------------------
 * 作者：  kitty-generator
 * 时间：  2019-12-27 14:37:08
 * 说明：  我是由代码生成器生生成的
 * ---------------------------
 */
@Service
public class SearchServiceImpl implements SearchService {

	@Autowired
	private SearchMapper searchMapper;

	@Override
	public int save(Search record) {
		if(record.getSearchId() == null || record.getSearchId() == 0) {
			return searchMapper.add(record);
		}
		return searchMapper.update(record);
	}

	@Override
	public int delete(Search record) {
		return searchMapper.delete(record.getSearchId());
	}

	@Override
	public int delete(List<Search> records) {
		for(Search record:records) {
			delete(record);
		}
		return 1;
	}

	@Override
	public Search findById(Integer id) {
		return searchMapper.findById(id);
	}


//	@Override
//	public PageResult findPage(PageRequest pageRequest) {
//		return MybatisPageHelper.findPage(pageRequest, searchMapper);
//	}
	
}
